from Api.ihrmEmpManageApi import EmpMangeApi
from common.assretTools import common_tools
from common.dbTools import DBTools
from common.getHeader import get_header


class TestQueryEmp(object):
    def setup_class(self):
        self.emp = EmpMangeApi()
        self.req_header = get_header()
    def setup(self):
        DBTools.db_iud("insert into bs_user(id,mobile,username)values('77788899','15677885599','袅袅');")
    def teardown(self):
        DBTools.db_iud("delete from bs_user where id='77788899';")

    def test01_query_success(self):
        resp = self.emp.get_emp("77788899", self.req_header)
        print("查询成功", resp.json())

        common_tools(resp, 200, True, 10000, "操作成功")
    def test02_emp_id_no_exists(self):
        resp =self.emp.get_emp("0011224457", self.req_header)
        print("员工id不存在", resp.json())
        common_tools(resp, 200, False, 20005, "失败")


